package me.sealer.ssm.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver;

import java.util.Properties;

/**
 * 功能描述： $ ExceptionConfig
 *
 * @author sealer
 * @email 1178884049@qq.com
 * @date 2019年12月17日 17时23分37秒
 */
@Configuration
public class ExceptionConfig {
    @Bean
    public SimpleMappingExceptionResolver exceptionResolver() {
        SimpleMappingExceptionResolver exceptionResolver = new SimpleMappingExceptionResolver();
        Properties properties = new Properties();
        properties.setProperty("org.springframework.web.multipart.MaxUploadSizeExceededException", "fileUploadError");
        exceptionResolver.setExceptionMappings(properties);
        return exceptionResolver;
    }
}
